<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>

</head>
<body>
        <div id="app">
                <mycomponet1>
                  <div slot-scope="scope" slot="content">
                    {{scope.student.name}}--{{scope.student.sex}}
                  </div>
                  <template v-slot:content2="scope">
                    {{scope.student.name}}--{{scope.student.sex}}
                  </template>
                </mycomponet1>
              </div>
              <script>
                Vue.component('mycomponet1', {
                  template: `
                    <div>
                      <h2>我是标题</h2>
                        <slot name="content" :student="student"></slot>
                        <slot name="content2" :student="student"></slot>
                    </div>
                  `,
                  data() {
                    return {
                      student: {
                        name: 'ly',
                        age: 21,
                        sex: 'male'
                      }
                    }
                  }
                })
            
                //根组件
                var app = new Vue({
                  el: '#app'
                })
              </script>
</body>
</html>